package com.lza.controller;


import com.lza.entity.User;
import com.lza.response.Result;
import com.lza.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lizhaoao
 * @since 2021-10-04
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;
    @PostMapping("login")
        public Result login(@RequestBody User user, HttpServletRequest httpServletRequest){
            return userService.login(user.getUsername(), user.getPassword(), httpServletRequest);
        }

}

